/*
 * @Description:
 * @Author: owen
 * @Date: 2021-03-31 19:54:20
 * @LastEditTime: 2023-03-29 11:05:25
 */
import { isObject } from '~/utils/tools'
import { optObject } from '../config'
import { has, curry, equals, isEmpty, is } from 'ramda'
function isRableSlotScope(arg: any): arg is F.RableSlotScope {
	return isObject(arg)
}
type Key = string | number | F.RableSlotScope


export const configFilter = (prop: string, key: Key) => {
	if (isRableSlotScope(key)) {
		key = key.text
	}
	if (has(prop, optObject)) {
		return optObject[prop][key as string]
	}
	return key
}

export const configCurryFilter = curry(configFilter)
